<?php

namespace app\controller;

use app\BaseController;
use app\controller\model\Tables;
use app\controller\model\apis\service\Bochuang;
use liliuwei\think\Auth;
use EasyDingTalk\Application;
use think\facade\Session;
use think\facade\Db;

class Test extends BaseController
{
    protected $getpath = "";
    protected $gobaluser = "";
    protected $tables;

    public function __construct()
    {
        $this->tables=new Tables();
    }
    
    public function setD(){
        $data = (new Bochuang([]))->setD0(request()->param("act"));
        return json($data);
    }
    
	public function pushOrder(){
		$post = request()->param();
		$file=fopen("./t_notify.txt","w");
        fwrite($file,json_encode($post));
        fclose($file);
		echo "success";
		exit();
	}
	public function mkSign(){
		$str="channelType=1&orderNo=JZX20250708185445175197208556780&refundResult=true&key=8aef995ff71485dc19b36e35f04c4016";
		echo strtoupper(md5($str));
		exit();
	}
	public function pushGas(){
		$this->pushOrder();
	}
    public function index2()
    {
		$order = DB::name($this->tables->orders)->where("id",18)->find();
	    $model = new \app\controller\model\Supplier(2);
//	    $model->confirmOrder($order);
//	    var_dump($model->returnOrder($order));
//	    $model->cancelOrder('JCH20240925005228534');
//	    $model->test(8);
	    $model->getGasList(9);
	}
    public function indexHi()
    {
		$order = DB::name($this->tables->orders)->where("id",16)->find();
	    $model = new \app\controller\model\Supplier(4);
//	    $model->confirmOrder($order);
	    var_dump($model->returnOrder($order));
//	    $model->cancelOrder('JCH20240925005228534');
//	    $model->test(8);
//	    $model->getGasList(8);
	}
    public function returnOrder()
    {
	   $model = new \app\controller\model\Supplier(4);
	   $re = $model->returnOrder('JZX20250708175528175196852840491');
	   echojson($re);
	}
}
